<style>
.layui-container{
	width:100%;
}
.layui-card,layui-row{
	margin:10px;
}
.layui-card table tr td:nth-child(2){
	font-weight:700;
}
</style>
<div class="layui-container layui-bg-gray">
    <div class="layui-row">
		<div class="layui-col-md4">
			<div class="layui-card">
				<div class="layui-card-header"><i class="fa fa-fire icon"></i> 商机信息</div>
				<div class="layui-card-body">
				  
				<table class="layui-table">
					<colgroup>
						<col width="100">
						<col>
					</colgroup>
					<tbody>
						<tr>
							<td>商机名称名称</td>
							<td>{$business.name}</td>
						</tr>
						<tr>
							<td>商机金额</td>
							<td>{$business.money}</td>
						</tr>
						<tr>
							<td>预计成交</td>
							<td>{$business.deal_time}</td>
						</tr>
						<tr>
							<td>备注</td>
							<td>{$business.remark}</td>
						</tr>
					</tbody>
				</table>				
				</div>
			</div>
		</div>
		<div class="layui-col-md8">
			<div class="layui-card">
				<div class="layui-card-header"><i class="fa fa-fire icon"></i> 跟进操作</div>
				<div class="layui-card-body">
					<form class="layui-form layui-form-pane layuimini-form">
						<div class="layui-form-item">
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">跟进内容:</label>
								<div class="layui-input-block">
									<textarea name="content" lay-verify="required" class="layui-textarea"
										placeholder=""></textarea>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-label">下次跟进时间:</label>
								<div class="layui-input-inline">
									<input type="text" name="next_time" data-date="" data-date-type="datetime" class="layui-input" autocomplete="off">
								</div>
								<div class="layui-form-mid layui-word-aux">如不需要再跟进 可设置为空</div>
							</div>

							<div class="layui-form-item">
								<label class="layui-form-label">跟进方式:</label>
								<div class="layui-input-inline">
									<select name="record_type" lay-verify="required">
										{volist name="record_methods" id="name" key="id"}
										<option value="{$id}">{$name}</option>
										{/volist}
									</select>
								</div>
							</div>
							<div class="layui-form-item">
							<div class="layui-input-block">
									<button class="layui-btn layui-btn-normal" lay-submit="{:url('business.record/add',['cid'=>$business.id,'type'=>'business'])}" lay-filter="saveBtn">立即保存</button>
									<button type="reset" class="layui-btn layui-btn-primary">重置信息</button>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<div class="layui-row">
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-header">
					<i class="fa fa-fire icon"></i> 跟进记录
				</div>
				<div class="layui-card-body">
					<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
				</div>
			</div>	
		</div>
	</div>
</div>

<script>

    layui.use(['form','jquery', 'layer','table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.jquery;
            table.render({
                elem: '#currentTableId',
                url: '/crm/business.index/record?id={$business.id}',
                cols: [[
                    { field: 'id', title: 'ID', sort: true },
                    { field: 'content', title: '内容' },
                    { field: 'create_user',title: '创建人',templet:function(d){return d.create_user.username} },
					{ field: 'record_type', title: '跟进类型' },
                    { field: 'create_time', title: '创建时间' },
                    { field: 'next_time', title: '下次跟进' }
                ]],
                page: true
            });
			// 新增跟进记录
			
    });
</script>